cmake_minimum_required(VERSION 3.10.0)
project(pikachu VERSION 0.1.0 LANGUAGES C CXX)

find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)

add_executable(pikachu
                "src/main.cpp"
                "src/Game.cpp"
                "src/Scene.cpp"
                "src/SceneMain.cpp"
                "src/SceneTitle.cpp"
                "src/SceneEnd.cpp"
)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})

include_directories(${SDL2_INCLUDE_DIR}
                    ${SDL2_IMAGE_INCLUDE_DIR}
                    ${SDL2_TTF_INCLUDE_DIR}
                    ${SDL2_MIXER_INCLUDE_DIR}
)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
    # target_link_libraries(pikachu mingw32)
    target_link_libraries(pikachu SDL2main)
    target_link_libraries(pikachu SDL2)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
    target_link_libraries(pikachu mingw32)
    target_link_libraries(pikachu SDL2main)
    target_link_libraries(pikachu SDL2)
    target_link_options(pikachu PRIVATE -mwindows)
endif()

target_link_libraries(pikachu
                        ${SDL2_LIBRARY}
                        SDL2_image::SDL2_image
                        SDL2_ttf::SDL2_ttf
                        SDL2_mixer::SDL2_mixer
                        # ${SDL2_IMAGE_LIBRARIES}
                        # ${SDL2_TTF_LIBRARIES}
                        # ${SDL2_MIXER_LIBRARIES}
)